home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
MacMETH 3.2.4
/
Examples
/
Example.MOD
< prev
next >
Wrap
Text File
|
1996-06-20
|
730b
|
24 lines
MODULE Example; (* W. Heiz, 26-Feb-86 / A. Fischlin, 4-Sep-92 *)
(* this program will produce two runtime errors (why?) *)
FROM Terminal IMPORT WriteString, WriteLn;
VAR x: INTEGER;
a: ARRAY [0..10] OF BOOLEAN;
PROCEDURE P(i: INTEGER; p: BOOLEAN);
BEGIN
a[i] := p; (* this statement should be high-lighted; Select Quit, then «Abort» *)
END P;
BEGIN
WriteString('Welcome to the wonderful world of Modula-2'); WriteLn; WriteLn;
WriteString("--- Debugger demo, please click in button «Debug» or type 'D'"); WriteLn;
x := 14;
P(0, TRUE);
HALT; (* Leave debugger by selecting menu command Continue *)
WriteString("--- Please click in button «Debug» or type 'D'");
P(x, FALSE);
END Example.